﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RBS.Core.BLL;
using RBS.Web.Hotel.Controllers;

namespace RBS.Web.Hotel.Areas.Settlement.Controllers
{
    public class StatisticsController : BaseController
    {
        //
        // GET: /Settlement/Statistics/
        SpBll _spBll = new SpBll();
        public ActionResult ThatDay(string day=null)
        { 
            var model = _spBll.GetThatDay(CurrentUser.HotelId, DateTime.Now); 
            return View(model);
        }

        public ActionResult ThatMonth(string month = null)
        {

            if (month == null)
            {
                month = DateTime.Now.ToShortDateString();
            } 
            var model = _spBll.GetThatMonth(CurrentUser.HotelId, DateTime.Parse(month));
            return View(model);

        }
         
        
        public ActionResult DayStatistics(string day)
        {
            if (day == null)
            {
                day = DateTime.Now.ToShortDateString();
            } 
            var model =
                new RBS.Core.BLL.D_Settlement().GetModelList(" Hotelid=" + CurrentUser.HotelId + " and   datediff(day,paytime,'" + day + "')=0"); 
            return View(model);
        }
    }
}
